package com.example.permission.feign;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PutMapping;

@FeignClient(value = "permission-service")
public interface PermissionClient {
    /**
     * 绑定默认角色
     *
     * @param userId
     */
    @PutMapping("/permission/bindDefaultRole")
    void bindDefaultRole(Long userId);

    /**
     * 获取用户角色代码
     *
     * @param userId
     * @return
     */
    @GetMapping("/permission/getUserRoleCode")
    String getUserRoleCode(Long userId);

    /**
     * 升级为管理员
     * @param userId
     */
    @PutMapping("/permission/upgradeToAdmin")
    void upgradeToAdmin(Long userId);

    /**
     * 降级为普通用户
     * @param userId
     */
    @PutMapping("/permission/downgradeToUser")
    void downgradeToUser(Long userId);
}
